<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <title>聊天页面-信息列表</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../../css/common.css" />
    <link rel="stylesheet" type="text/css" href="../../css/aui-pull-refresh.css" />
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    <style>
        html,
        body {
            width: 100%;
            min-height: 100%;
            background: #f7f7f7;
            line-height: 1;
        }
        /*搜索按钮*/

        .search_box {
            display: flex;
            justify-content: center;
            align-items: center;
            margin: 0.45rem 0.75rem;
            background-color: #fff;
            padding: 0.4rem 0;
            border-radius: 0.1rem;
        }

        .search_box img {
            width: 0.625rem;
            margin-right: 0.25rem;
        }

        .search_box span {
            font-size: 0.7rem;
            color: #999;
        }
        /*群组列表*/

        .my_collection_shop_list {
            display: flex;
            align-items: center;
            padding: 1rem 0.75rem;
            background-color: #fff;
            position: relative;
        }

        .my_collection_shop_list::after {
            content: "";
            height: 1px;
            width: calc(100% - 0.75rem);
            background-color: #e6e6e6;
            position: absolute;
            bottom: 0;
            right: 0;
        }

        .my_collection_shop_list:last-child::after {
            height: 0;
        }

        /*.my_collection_shop_list img {
            width: 1.5rem;
            margin-right: 0.75rem;
        }*/

        .my_collection_shop_list .shop_name {
            font-size: 0.8rem;
            color: #333;
            text-align: justify;
        }
    </style>
</head>

<body>
    <div class="app">
        <div class="my_collection_shop">
            <div class="search_box">
                <img src="../../image/four/search.png" alt="">
                <span>搜索</span>
            </div>
            <ul>
                <li v-for="list_data in shop_list_data" class="my_collection_shop_list" @click="send_shop_msg(list_data)">
                    <!-- <img src="../../image/four/test.jpg" alt=""> -->
                    <div :style="'background:url('+list_data.logo_pic+') center/cover no-repeat;width:1.5rem;height:1.5rem;margin-right:0.75rem;'"></div>
                    <span class="shop_name">{{list_data.goods_title}}</span>
                </li>
            </ul>
        </div>

    </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/jquery.min.js"></script>
<script type="text/javascript" src="../../script/vue.min.js"></script>
<script type="text/javascript" src="../../script/utils.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript" src="../../script/aui-tab.js"></script>
<script type="text/javascript" src="../../script/aui-scroll.js"></script>
<script type="text/javascript" src="../../script/aui-pull-refresh.js"></script>
<script type="text/javascript">
    apiready = function() {

        // 实例化vue 渲染数据
        var my_shop_list = new Vue({
            el: '.app',
            data: {
                page: 1,
                shop_list_data: []
            },
            created: function() {
                var $_this = this;
                $_this.get_list_data();
            },
            methods: {
                get_list_data: function() {
                    var $_this = this;
                    api.ajax({
                        url: window.Url.Freeucenter_myShop,
                        method: 'post',
                        data: {
                            values: {
                                token: $api.getStorage('user_data').token,
                                page: $_this.page
                            }
                        }
                    }, function(ret, err) {
                        if (ret) {
                            if (ret.re != 1) {
                                api.toast({
                                    msg: ret.info,
                                    duration: 2000,
                                    location: 'bottom'
                                });
                            } else {
                                $_this.shop_list_data = ret.data.list;
                            }
                            // console.log(JSON.stringify(ret));
                        } else {
                            api.alert({
                                msg: JSON.stringify(err)
                            });
                        }
                    })
                },
                // 给上一个页面发送 选中商品的数据信息
                send_shop_msg:function(msg){
                  api.sendEvent({
                      name: 'my_chose_shop_msg',
                      extra: {
                          chose_shop_msg:msg
                      }
                  });

                  api.closeWin({});
                }
            }
        })
    };
</script>

</html>
